package com.jack.cms.common.constant.tips;

import org.springframework.http.HttpStatus;

import com.jack.cms.common.exception.BizExceptionEnum;

/**
 * 返回给前台的错误提示
 *
 * @author JackYuan
 * @date 2016年11月12日 下午5:05:22
 */
public class ErrorTip<T> extends Tip<T> {

	// HttpStatus.BAD_REQUEST.value()
	public static final int CODE = 400;
	public static final String MESSAGE = "业务异常";

	public ErrorTip(BizExceptionEnum e) {
		this(e.getCode(), null, e.getMessage());
	}

	public ErrorTip(String message) {
		this(null, message);
	}

	public ErrorTip(int code, String message) {
		this(code, null, message);
	}

	public ErrorTip(T content, String message) {
		this(HttpStatus.INTERNAL_SERVER_ERROR.value(), content, message);
	}

	public ErrorTip(int code, T content, String message) {
		super();
		this.code = code;
		this.content = content;
		this.message = message;
	}

}
